$direction: (top:t, right:r, bottom:b, left:l);
$span: (-1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 30, 36, 40, 50, 60);
@each $i in $span {
    @each $k,
    $v in $direction {
        .m#{$v}#{$i},
        .m#{$i} #{if($k==top,',.my' + $i,'')} #{if($k==bottom,',.my' + $i, '')} #{if($k==left,',.mx' + $i, '')} #{if($k==right,',.mx' + $i, '')} {
            margin-#{$k}: $i*1px;
        }
        .p#{$v}#{$i},
        .p#{$i} #{if($k==top,',.py' + $i,'')} #{if($k==bottom,',.py' + $i, '')} #{if($k==left,',.px' + $i, '')} #{if($k==right,',.px' + $i, '')} {
            padding-#{$k}: $i*1px;
        }
    }
}